package com.hnas.ecard.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.ecard.dao.AccECardDAO;
import com.hnas.ecard.orm.AccECard;
import com.hnas.ecard.service.AccECardService;

@Component("accECardService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class AccECardServiceImpl implements AccECardService {
	
	private static Log log = LogFactory.getLog(AccECardServiceImpl.class);
	
	@Autowired
	private AccECardDAO accECardDAO;
	
	@Value("#{component['subCode']}") // 发卡类型
	private String subCode;

	@Override
	public List<AccECard> findByECard(AccECard vo) {
		return accECardDAO.findByECardSql(vo);
	}

	@Override
	public List<AccECard> searchECard(AccECard vo) {
		return accECardDAO.findByECardSql(vo);
	}

	@Override
	public AccECard saveOrUpdate(AccECard vo) throws Exception {
		return accECardDAO.saveOrUpdate(vo);
	}

}
